package com.wyw.design.model.learning.behavioral.emptyobject;

/**
 * @Title   商品工厂类
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2023/4/19 15:39
 * Update History:
 * Author        Time            Content
 */
public class GoodsFactory {
    public static AbstractGoods find(final String isbn) {
        AbstractGoods result = null;
        switch (isbn) {
            case "001":
                result = new ConcreteGoods("001", "Java面试全解析", 69.0);
                break;
            case "002":
                result = new ConcreteGoods("002", "MySQL面试金典", 19.0);
                break;
            default:
                result = new NullGoods();
                break;
        }
        return result;
    }
}
